home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 1 / Atari Mega Archive - Volume 1.iso / lists / mint / l_0799 / 561 < prev    next >
Encoding:
Internet Message Format  |  1994-08-27  |  2.3 KB

  1. From: itschere@techfak.uni-bielefeld.de
  2. Subject: Re: pipes & ptys
  3. Date: Wed, 20 Oct 93 1:39:45 MET
  4.  
  5. Juergen Lock
  6. > > Well, what else can I do in a Program like a window manager, if I've
  7. > > got to look for every char?
  8. >  well Eric said that already but in different words... :)  a 1k RAW
  9. > read() does not block until it has read 1k, only until _some_ data is
  10. > available. (pty master reads are always RAW)  if it receives 200 bytes
  11. > (i.e. pty slave write()s 200 bytes) it returns 200 bytes, if data comes
  12. > in 1-byte-at-a-time it reads 1 byte, or whatever has accumulated in the
  13. > buffer (pipe) since the last read.
  14. >  so look at each char does not mean you need one system call for each
  15. > char...
  16.  
  17. Ok, got this, but: (see my other mail) it will return as soon as ther is
  18. some data, say, when it get's its next time slice, which is 16ms long on
  19. my 60Hz TT-VBL, right? Now I estimate that the writer (if really (worst case,
  20. of course, but that's what counts.)) using 1 bytes I/O, doesn't manage
  21. to output more than something like 30 chars per timeslice, so 60 slices
  22. a 30 bytes (always completely ignoring the time I need to read the data),~
  23. makes 1800 CPS, and that looks like the number I've measured.
  24.  
  25. > >   Point is that system calling overhead is soooo big that it doesn't matter
  26. > > a lot if the pipefs has got to do 1 or 4 bytes read.
  27. >  yes but it doesn't... have to do single-char IO.  and when you have
  28. > larger read/writes this character shuffling can cause overhead of
  29. > n times the size of the actual device IO.
  30.  
  31. Perhaps we can start a personal dispute about this, but so far I heavily
  32. doubt this. Sorry, no proofs so far... :-(
  33.  
  34. > type            read    write    speed (CPS)    % CPU load (top)
  35. > -----------------------------------------------------------
  36. > pipe            4096    4096    270000
  37. > pty            4096    4096    a bit less
  38. >  pty output would get nearly as fast as the pipe, and serial ports could
  39. > run full speed and no longer eat up all available cycles...
  40.  
  41. If a) you really use big chunks and b) modems are operated by interrupt...
  42.  
  43. > >  At least at my setup the involved device
  44. > > drivers can easily be fixed.
  45. >  hmm how do you mean that?
  46.  
  47. Well, to make the biosfs drives expect char pointers instead longs. None
  48. of my program _seems_ to complain about this. But obviously that's no
  49. compatible solution... ;-)
  50.  
  51. [other stuff deleted, 'cause it's clear to me now]
  52.  
  53. bye,
  54. TeSche
  55.  
  56.  
  57.